package edu.hhu.wifispark.task;

import java.util.Date;
import java.util.List;

import edu.hhu.wifispark.entry.BasePhone;
import edu.hhu.wifispark.task.sparktask.RecordTask;
import edu.hhu.wifispark.util.DateUtil;

public class ObtainRecord {
	public void start(){
		long nowtime = new Date().getTime();
		long endtime = DateUtil.getHour(nowtime);
		long starttime = endtime -3600000;
		List<BasePhone> bps = BasePhone.dao.findToday(starttime, endtime);
		if (bps == null) {
			return;
		}
		RecordTask recordTask = new RecordTask(starttime);
		recordTask.setBps(bps);
		recordTask.start();
		try {
			recordTask.join();
		} catch (InterruptedException e) {
		}
	}
	
}
